package com.netease.financial.base.lockpattern;

import android.content.Context;

import java.io.File;

/**
 * Created by hzwuyufeng on 1/15/16.
 */
public class Environment {
    /**
     * Return the system directory for a user. This is for use by system services to store
     * files relating to the user. This directory will be automatically deleted when the user
     * is removed.
     *
     * @hide
     */
    public static File getUserSystemDirectory(Context context, String userId) {
        File users = new File(context.getFilesDir(), "users");
        if (!users.exists()) {
            users.mkdir();
        }
        File userDirectory = new File(users, userId);
        if (!userDirectory.exists()) {
            userDirectory.mkdir();
        }
        return userDirectory;
    }

}
